<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>get提交方式</title>
</head>
<body>
<form action="#" method="post" id="form">
    username:<input type="text" name="username" id="username"/><br/>
    password:<input type="text" name="password" id="password"/><br/>
    <input type="submit" value="提交"/>
</form>
</body>
<script src="js/jquery-2.1.0.min.js"></script>
<script>
        $.ajax({
            type:'GET',//提交方式
            url:'jsonServlet',//发送的路径
            async:true,//是否异步
            data_type:"json",//返回数据的类型
            success:function (data) {
                alert(data.length);
                //alert(data);
                for(let i=0;i<data.length;i++){
                    alert(data[i].username);
                    alert(data[i].password);
                }
            }
        });
</script>
</html>